home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / plugin_loading.inc < prev    next >
Encoding:
Text File  |  2003-02-21  |  5.8 KB  |  143 lines

  1. <%
  2. '+-------------------------------------------------------------------------
  3. '
  4. '  Microsoft Windows Media
  5. '  Copyright (C) Microsoft Corporation. All rights reserved.
  6. '
  7. '  File:       plugin_loading.inc
  8. '
  9. '  Contents:    server-side included with certain plugin property pages
  10. '
  11. '--------------------------------------------------------------------------
  12.  
  13.  
  14. 'enum WMS_PLUGIN_LOAD_TYPE
  15. Const WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED = 0
  16. Const WMS_PLUGIN_LOAD_TYPE_IN_PROC     = 1
  17. Const WMS_PLUGIN_LOAD_TYPE_OUT_OF_PROC = 2
  18. Const WMS_NUM_PLUGIN_LOAD_TYPE         = 3
  19.  
  20. 'enum WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE
  21. Const WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE_NONE         = 0
  22. Const WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE_IN_PROC      = 1
  23. Const WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE_OUT_OF_PROC  = 2
  24.  
  25. Dim enumLoaded
  26. Dim enumLoadSetting
  27. Dim enumDefaultLoadSetting
  28. Dim enumPluginUnsupportedLoadType
  29. Dim bLoadedInProc
  30. Dim bLoadInProc
  31. Dim strInProcess
  32. Dim strOutOfProcess
  33. Dim strCurrentLoadType
  34.  
  35. '////////////////////////////////////////////////////////////////////////////////////
  36. function HandlePluginLoadingChanges()
  37.     if( 0 = strComp( "inproc", GetPostOrQsVal( "pluginloading" ), vbTextCompare ) ) then
  38.         if( WMS_PLUGIN_LOAD_TYPE_IN_PROC <> g_objPlugin.LoadType ) then
  39.             g_objPlugin.LoadType = WMS_PLUGIN_LOAD_TYPE_IN_PROC
  40.         end if
  41.     elseif( 0 = strComp( "outofproc", GetPostOrQsVal( "pluginloading" ), vbTextCompare ) ) then
  42.         if( WMS_PLUGIN_LOAD_TYPE_OUT_OF_PROC <> g_objPlugin.LoadType ) then
  43.             g_objPlugin.LoadType = WMS_PLUGIN_LOAD_TYPE_OUT_OF_PROC
  44.         end if
  45.     end if
  46. end function
  47.  
  48. '////////////////////////////////////////////////////////////////////////////////////
  49. sub RenderPluginLoadingOptions()
  50.     on error resume next
  51.     enumDefaultLoadSetting = g_objServer.DefaultPluginLoadType    ' start with default
  52.     enumPluginUnsupportedLoadType = g_objPlugin.Properties( "UnsupportedLoadType" )
  53.     if( IsEmpty( enumPluginUnsupportedLoadType ) )then
  54.         enumPluginUnsupportedLoadType = WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED
  55.     end if
  56.  
  57.     enumLoaded = g_objPlugin.Status
  58.     enumLoadSetting = g_objPlugin.LoadType
  59.     if( WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED = enumLoadSetting ) then
  60.         if( WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED = enumDefaultLoadSetting ) then
  61.             if( WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE_NONE = enumPluginUnsupportedLoadType ) then
  62.                 enumLoadSetting = WMS_PLUGIN_LOAD_TYPE_IN_PROC
  63.             elseif( WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE_IN_PROC = enumPluginUnsupportedLoadType ) then    ' BUG:  what if this isn't supported?
  64.                 enumLoadSetting = WMS_PLUGIN_LOAD_TYPE_OUT_OF_PROC
  65.             elseif( WMS_PLUGIN_UNSUPPORTED_LOAD_TYPE_OUT_OF_PROC = enumPluginUnsupportedLoadType ) then    ' BUG:  what if this isn't supported?
  66.                 enumLoadSetting = WMS_PLUGIN_LOAD_TYPE_IN_PROC
  67.             end if
  68.         else
  69.             enumLoadSetting = enumDefaultLoadSetting
  70.         end if
  71.     else
  72.         bLoadInProc = CBool( ( WMS_PLUGIN_LOAD_TYPE_IN_PROC = enumLoadSetting ) )
  73.     end if
  74.  
  75.     if( WMS_PLUGIN_LOAD_TYPE_IN_PROC = enumLoadSetting ) then
  76.         bLoadInProc = TRUE
  77.         strInProcess = L_LOADINPROC_TEXT
  78.         strOutOfProcess = L_LOADOOFPROCRESTART_TEXT
  79.     else
  80.         bLoadInProc = FALSE
  81.         strInProcess = L_LOADINPROCRESTART_TEXT
  82.         strOutOfProcess = L_LOADOOFPROC_TEXT
  83.     end if
  84.  
  85.     if( WMS_PLUGIN_LOADED_IN_PROC and enumLoaded ) then
  86.         strCurrentLoadType = L_LOADEDINPROC_TEXT
  87.     else
  88.         strCurrentLoadType = L_LOADEDOOFPROC_TEXT
  89.     end if
  90.  
  91.     %>
  92.     <p>
  93.     <table border=1 cellspacing=2 cellpadding=0 class="propgroupbox" width="100%">
  94.     <caption align="left" class="pluginGroupHeader"><%= Server.HTMLEncode( L_PLUGINLOADING_TEXT ) %></caption>
  95.     <tr>
  96.         <td> <br>
  97.             <table cellspacing=0 border=0 class="propgroupbox">
  98.             <tr>
  99.                 <td><img src="..\img\spacer_.gif" height="1px" width="10px"></td>
  100.                 <td class="helptext" bgcolor="lightyellow">
  101.                     <%= Server.HTMLEncode( L_LOADED_TEXT ) %> <b><%= Server.HTMLEncode( strCurrentLoadType ) %></b>
  102.                 </td>
  103.             </tr>
  104.             <tr>
  105.                 <td><img src="..\img\spacer_.gif" height="1px" width="10px"></td>
  106.                 <td colspan=3 class="helptext">
  107.                     <br>
  108.                     <%= Server.HTMLEncode( L_LOADINGDELTARESTART_TEXT ) %>
  109.                 </td>
  110.             </tr>
  111.             </table>
  112.             <table border=0 cellspacing=0 cellpadding=0 class="propgroupbox" width="100%">
  113.             <tr>
  114.                 <td><img src="..\img\spacer_.gif" height="1px" width="10px"></td>
  115.                 <td align=left>
  116.                     <% dwTabIndex = dwTabIndex + 1 %>
  117.                     <input type="radio"
  118.                            id="inproc"
  119.                            name="pluginloading"
  120.                            value="inproc" <% if bLoadInProc then %>checked<% end if %> 
  121.                            tabIndex=<%= dwTabIndex %>>
  122.                     <label for="inproc" class="handcursor"><% RenderWithErrorCheck Server.HTMLEncode( strInProcess) , "inproc" %></label> 
  123.                 </td>
  124.             </tr>
  125.             <tr>
  126.                 <td><img src="..\img\spacer_.gif" height="1px" width="10px"></td>
  127.                 <td align=left>
  128.                     <% dwTabIndex = dwTabIndex + 1 %>
  129.                     <input type="radio"
  130.                            id="oop"
  131.                            name="pluginloading"
  132.                            value="outofproc" <% if not bLoadInProc then %>checked<% end if %> 
  133.                            tabIndex=<%= dwTabIndex %>>
  134.                     <label for="oop" class="handcursor"><% RenderWithErrorCheck Server.HTMLEncode( strOutOfProcess ), "oofproc" %></label>
  135.                 </td>
  136.             </tr>
  137.             </table>
  138.         </td>
  139.     </tr>
  140.     </table>
  141. <%
  142. end sub
  143. %>